<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="author" content="garrick" />
    <meta name="robots" content="index, follow"/>

    <meta property="og:title" content="My first artical in this site"/>
    <meta property="og:url" content="/my-first-post.html"/>
    <meta property="og:site_name" content="Garrick's blog"/>
    <meta property="og:type" content="article"/>

    <link rel="canonical" href="/my-first-post.html" />

    <title>My first artical in this site | Garrick's blog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
    <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" />

    <link rel="stylesheet" type="text/css" href="/theme/css/main.css" />

    <script type="text/javascript">var switchTo5x=true;</script>
    <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
    <script type="text/javascript">
        stLight.options({
            publisher: "",
            doNotHash: false,
            doNotCopy: false,
            hashAddressBar: false
        });
    </script>
</head>

<body id="index">
    <div class="row-fluid">
        <div class="span10 offset1">
            <header id="banner" >
                <h1>
                    <a href="/">Garrick's blog </a>
                </h1>
                <nav class="navbar">
                    <div class="navbar-inner">
                        <ul class="nav">
                            <li class="active"><a href="/category/blogs.html">blogs</a></li>
                        </ul>

                    </div>
                </nav>
            </header><!-- /#banner -->
        </div>
    </div>

    <div class="row-fluid">
        <div class="span10 offset1">
            <div class="row-fluid">
<div class="span10 offset1">
  <section>
    <article>
      <header>
        <h1 class="entry-title">
          <a href="/my-first-post.html" rel="bookmark"
             title="Permalink to My first artical in this site">My first artical in this site</a></h1>
      </header>
      <div class="entry-content">
<footer class="post-info">
    <address class="vcard author">
        by <a class="url fn" href="/author/garrick.html">garrick</a>
    </address>

    in <a href="/category/blogs.html">blogs</a>

    on 2019-12-06

        |
        tags:         <a href="/tag/pelican.html">pelican</a>
        <a href="/tag/publishing.html">publishing</a>



    
</footer><!-- /.post-info -->

        <p>This is the content of my first blog post in this site.</p>
<p>这应该是一篇草稿。</p>
<div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>

<span class="k">def</span> <span class="nf">kernel_mat</span><span class="p">(</span><span class="n">A</span><span class="p">,</span> <span class="n">B</span><span class="p">):</span>
    <span class="n">m</span><span class="p">,</span> <span class="n">k</span> <span class="o">=</span> <span class="n">A</span><span class="o">.</span><span class="n">shape</span>
    <span class="n">k</span><span class="p">,</span> <span class="n">n</span> <span class="o">=</span> <span class="n">B</span><span class="o">.</span><span class="n">shape</span>
    <span class="n">r</span> <span class="o">=</span> <span class="mi">4</span>
    <span class="n">C</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">((</span><span class="n">m</span><span class="p">,</span><span class="n">n</span><span class="p">))</span>
    <span class="k">for</span> <span class="n">ra</span> <span class="ow">in</span> <span class="n">xrange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">r</span><span class="p">):</span>
        <span class="k">for</span> <span class="n">rb</span> <span class="ow">in</span> <span class="n">xrange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">r</span><span class="p">):</span>
            <span class="n">subA</span> <span class="o">=</span> <span class="n">A</span><span class="p">[:,</span><span class="n">ra</span><span class="p">:</span><span class="n">ra</span><span class="o">+</span><span class="n">r</span><span class="p">]</span>
            <span class="n">subB</span> <span class="o">=</span> <span class="n">B</span><span class="p">[</span><span class="n">rb</span><span class="p">:</span><span class="n">rb</span><span class="o">+</span><span class="n">r</span><span class="p">,:]</span>
            <span class="n">C</span> <span class="o">+=</span> <span class="n">subA</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">subB</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">C</span>
</pre></div>


<div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf">&quot;gtest/gtest.h&quot;</span><span class="cp"></span>
<span class="cp">#include</span> <span class="cpf">&quot;absl/base/casts.h&quot;</span><span class="cp"></span>
<span class="cp">#include</span> <span class="cpf">&quot;absl/base/macros.h&quot;</span><span class="cp"></span>

<span class="k">namespace</span> <span class="n">absl</span> <span class="p">{</span>
<span class="k">namespace</span> <span class="p">{</span>

<span class="k">template</span> <span class="o">&lt;</span><span class="kt">int</span> <span class="n">N</span><span class="o">&gt;</span>
<span class="k">struct</span> <span class="n">marshall</span> <span class="p">{</span> <span class="kt">char</span> <span class="n">buf</span><span class="p">[</span><span class="n">N</span><span class="p">];</span> <span class="p">};</span>

<span class="k">template</span> <span class="o">&lt;</span><span class="k">typename</span> <span class="n">T</span><span class="o">&gt;</span>
<span class="kt">void</span> <span class="n">TestMarshall</span><span class="p">(</span><span class="k">const</span> <span class="n">T</span> <span class="n">values</span><span class="p">[],</span> <span class="kt">int</span> <span class="n">num_values</span><span class="p">)</span> <span class="p">{</span>
  <span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">num_values</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">T</span> <span class="n">t0</span> <span class="o">=</span> <span class="n">values</span><span class="p">[</span><span class="n">i</span><span class="p">];</span>
    <span class="n">marshall</span><span class="o">&lt;</span><span class="k">sizeof</span><span class="p">(</span><span class="n">T</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">m0</span> <span class="o">=</span> <span class="n">absl</span><span class="o">::</span><span class="n">bit_cast</span><span class="o">&lt;</span><span class="n">marshall</span><span class="o">&lt;</span><span class="k">sizeof</span><span class="p">(</span><span class="n">T</span><span class="p">)</span><span class="o">&gt;</span> <span class="o">&gt;</span><span class="p">(</span><span class="n">t0</span><span class="p">);</span>
    <span class="n">T</span> <span class="n">t1</span> <span class="o">=</span> <span class="n">absl</span><span class="o">::</span><span class="n">bit_cast</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">m0</span><span class="p">);</span>
    <span class="n">marshall</span><span class="o">&lt;</span><span class="k">sizeof</span><span class="p">(</span><span class="n">T</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">m1</span> <span class="o">=</span> <span class="n">absl</span><span class="o">::</span><span class="n">bit_cast</span><span class="o">&lt;</span><span class="n">marshall</span><span class="o">&lt;</span><span class="k">sizeof</span><span class="p">(</span><span class="n">T</span><span class="p">)</span><span class="o">&gt;</span> <span class="o">&gt;</span><span class="p">(</span><span class="n">t1</span><span class="p">);</span>
    <span class="n">ASSERT_EQ</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">memcmp</span><span class="p">(</span><span class="o">&amp;</span><span class="n">t0</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">t1</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">T</span><span class="p">)));</span>
    <span class="n">ASSERT_EQ</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">memcmp</span><span class="p">(</span><span class="o">&amp;</span><span class="n">m0</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">m1</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">T</span><span class="p">)));</span>
  <span class="p">}</span>
<span class="p">}</span>
</pre></div>


<p>Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。</p>
<p>尝试新的跨平台 PowerShell https://aka.ms/pscore6</p>
<p>PS C:\Users\Garrick&gt;</p>

      </div><!-- /.entry-content -->

    </article>
  </section>
</div>
            </div>
        </div>
    </div>

    <footer id="site-footer">
        <div class="row-fluid">
            <div class="span10 offset1">
                <address>
                    <p>
                        This blog is proudly powered by <a href="http://getpelican.com/">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.
                    </p>
                    <p>
                        <a href="http://github.com/jsliang/pelican-fresh/">Fresh</a> is a responsive theme designed by <a href="http://jsliang.com/">jsliang</a> and <a href="https://github.com/jsliang/pelican-fresh/graphs/contributors">contributors</a>.
                        Special thanks to <a href="http://coding.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a> and <a href="http://getbootstrap.com/">Twitter Bootstrap</a>.
                    </p>
                </address>
            </div>
        </div>
    </footer>

    <script src="//code.jquery.com/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/2.3.2/js/bootstrap.min.js"></script>
</body>
</html>